/**
 * @projectName: com.xiayuanxing.designPattern
 * @className: Alarm
 * @author: xiayuanxing
 * @description: 具体的同事类
 * @date: 2022/1/10 16:25
 * @version: 1.0
 */
public class Alarm extends Colleague{


    /**构造器*/
    public Alarm(Mediator mediator, String name) {
        super(mediator, name);
        //在创建Alarm同事对象时，将自己放入到ConcreteMediator对象中[集合]
        mediator.Register(name,this);
    }

    public void SendAlarm(int stateChange){
        SendMessage(stateChange);
    }

    @Override
    public void SendMessage(int stateChange) {

        this.getMediator().GetMessage(stateChange,this.name);
    }
}
